Store ints as ints in the configuration object#1119
Merged
codeboten merged 5 commits intoopen-telemetry:masterfrom Sep 21, 2020
Merged
Store ints as ints in the configuration object#1119codeboten merged 5 commits intoopen-telemetry:masterfrom
codeboten merged 5 commits intoopen-telemetry:masterfrom
Conversation
codeboten
reviewed
Sep 16, 2020
| self.assertEqual(Configuration().POSITIVE_INTEGER, 123) | ||
| self.assertTrue(isinstance(Configuration().NEGATIVE_INTEGER, int)) | ||
| self.assertEqual(Configuration().NEGATIVE_INTEGER, -123) | ||
| self.assertEqual(Configuration().NON_INTEGER, "-12z3") |
Contributor
There was a problem hiding this comment.
Curious how these tests passed before this change
Contributor
Author
There was a problem hiding this comment.
Before, we didn't have tests that checked type (added them here with isinstance). And this:
Python 3.8.3 (default, Jun 29 2020, 18:03:36)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: 1 == 1.0
Out[1]: True
In [2]:
Contributor
There was a problem hiding this comment.
Ahhhhh right, that makes sense now.
lzchen
approved these changes
Sep 18, 2020
alertedsnake
pushed a commit
to alertedsnake/opentelemetry-python
that referenced
this pull request
Sep 25, 2020
Fixes open-telemetry#1118 Co-authored-by: alrex <aboten@lightstep.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The configuration object currently stores
"2"as"2.0". This change makes it store that value as"2".Fixes #1118
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Updated test to specifically test this change.
test_integerChecklist: